import sys,re
def quchu(in_string):
  while(1):
    ret = re.search(r'\([^(]*?\)',in_string) 
    if ret:
      re_string = ret.group() 
      re_sj = rjsuanfa(re_string.strip('()')) 
      in_string = in_string.replace(re_string,str(chuli))
      continue
    break
  re_sj = rjsuanfa(in_string)
  return float(re_sj)
def rjsuanfa(re_string):
  while 1:
    ret = re.search(r'\d+\.*?\d*[*/]\-?\d+\.?\d*', re_string)
    if ret: 
      chengchu_s = ret.group() 
      if '*' in chengchu_s:
        x,y = chengchu_s.split('*')
        res = float(x)*float(y) 
      if '/' in chengchu_s:
        x, y = chengchu_s.split('/')
        res = float(x)/float(y)  
      re_string = re_string.replace(chengchu_s, str(res)) 
      re_string =chulifuhao(re_string) 
      continue
    break
  num = re.findall(r'[+-]?\d+\.?\d*', re_string)
  if len(num) > 1:
    mynum = 0
    for i in num:
      mynum += float(i)
    return mynum
  else:
    return num[0]
def chulifuhao(a):
  if '--' in a:
    a = a.replace('--','+')
  if '++' in a:
    a = a.replace('++','+')
  if '+-' in a:
    a = a.replace('+-','-')
  if '-+' in a:
    a = a.replace('-+','-')
  return a
	
if __name__ == "__main__":
  incmd = sys.argv[1]
  star = incmd.replace(' ', '')
  rete = quchu(star) 
  print('return:'+str(rete))
